#include<iostream>
#include<queue>

using namespace std;
const int N=1e6+10;
int a[N];
int main()
{
	priority_queue<int> heap;
	int n,k;cin>>n>>k;
	long long sum=0;
	for(int i=0;i<n;i++)
    {
        int x;cin>>x;
        sum+=x;
        if(x%2==0) heap.push(x);
    }
	while(heap.size()&&k--)
	{
		int t=heap.top()/2;
		heap.pop();
		sum-=t;
		if(t%2==0)heap.push(t);
	}
	cout<<sum<<endl;
	return 0;
}